using System;
using System.Xml;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace Microsoft.MSE.Catalog.Module {
    [DataContract(Name="WCFCatalogSvcConfig",Namespace=MseConstants.MSENamespace)]
    public class CatalogSvcConfig {
        [DataMember(Order=0)]
        public bool DebugMode;
        [DataMember(Order=1)]
        public string DBConnString;
        [DataMember(Order=2)]
        public Uri baseAddress;
        [DataMember(Order = 3)]
        public ServiceEndpointElement[] serviceEndpoints;
        [DataMember(Order = 4)]
        public ServiceCatalogThrottle serviceCatalogThrottle;
        [DataMember(Order = 5, IsRequired = false)]
        public ServiceCatalogUddi serviceCatalogUddi;
        [DataMember(Order = 6, IsRequired = false)]
        public int StartupRetryInterval;
        [DataMember(Order = 7, IsRequired = false)]
        public int StartupRetryAttempts;
    }

    [DataContract(Name="WCFCatalogSvcEndpointElement",Namespace=MseConstants.MSENamespace)]
    public class ServiceEndpointElement {
        [DataMember(Order=0)]
        public Uri address;
        [DataMember(Order=1)]
        public XmlElement bindingXml;
    }

    [DataContract(Name = "ServiceCatalogThrottle", Namespace = MseConstants.MSENamespace)]
    public class ServiceCatalogThrottle
    {
        [DataMember(Order = 0)]
        public int MaxConcurrentCalls;
        [DataMember(Order = 1)]
        public int MaxConcurrentSessions;
        [DataMember(Order = 2)]
        public int MaxConcurrentInstances;
    }
    [DataContract(Name = "ServiceCatalogUddi", Namespace = MseConstants.MSENamespace)]
    public class ServiceCatalogUddi
    {
        [DataMember(Order = 0,IsRequired=true)]
        public bool UddiIntegrationMode;
        [DataMember(Order = 1)]
        public string UddiPublishUrl;
        [DataMember(Order = 2)]
        public string UddiInquireUrl;
        [DataMember(Order = 3)]
        public string UddiUserName;
        [DataMember(Order = 4)]
        public string UddiPassword;
        [DataMember(Order = 5)]
        public string BusinessKey;
        [DataMember(Order = 6)]
        public AuthnticationScheme UddiAuthenticationScheme;
    }
    [DataContract(Name = "AuthnticationScheme", Namespace = MseConstants.MSENamespace)]
    public enum AuthnticationScheme
    {
        [EnumMember]
        UDDI,
        [EnumMember]
        WINDOWS
    }
}
